package dfbz.expand;

import java.util.ArrayList;
import java.util.Random;
import java.util.Scanner;

public class Test02 {
    public static void main(String[] args) {
        ArrayList<Integer> list = CrateNum(3, new Random());
        while(true){
            System.out.println("请输入一个3-18的数字：");
            Scanner sc=new Scanner(System.in);
            int i=sc.nextInt();
            if(i>18||i<=3){
                System.out.println("这么下注你会死的很惨");
            }
            guess(list,i);
        }
    }
    public static ArrayList<Integer>  CrateNum(int count, Random rd){
        ArrayList<Integer> list=new ArrayList<>();
        for (int i = 1; i <=count; i++) {
            int num=rd.nextInt(7)+1;
            list.add(num);
        }
      return list;
    }
    public static void guess(ArrayList<Integer> list,int num){
        int touziNum=0;
        for (int i = 0; i <list.size(); i++) {
            touziNum+=list.get(i);
        }
        System.out.println("底牌为"+touziNum);
        if(touziNum>=3&&touziNum<=10){
            System.out.println("该数字为小------（3-10）");
        }else {
            System.out.println("该数字为小------（11-18）");
        }
        if(touziNum==num){
            System.out.println("发财了---win");
        }else if(touziNum<num){
            System.out.println("你猜的数字大了--lose");
        }else {
            System.out.println("你猜的数字小了--lose");
        }
    }
}
